function priorSummaryTable(draws, paramNames, options)
% Function to take draws from a prior and print latex table/PDF of summary
% statistics
% =========================================================================================
% [Inputs]:
% draws: a matrix of draws from the prior
% paramNames: a cell of names for each parameter drawn

% [Options]: (indeed optional)
% options.fileName: optional name for the file name
% options.printPDF: logical, 1 to print PDF
% options.outPath: optional folder to place created tables
% options.orientation: 'portrait' or 'landscape'
% options.maxRows: maximum number of rows per page
% options.maxCols: maximum number of columns per page
% =========================================================================================

if nargin < 3
    options = [];
end

if ~isfield(options,'tableHeader')
    options.tableHeader = {'Summary Statistics of Prior Draws'};
end

% Quietly compute summary statistics for draws
evalc('[out_cell out] = playmod_outdraws(draws,paramNames);');

% Create matrix of summary stats
summaryMat = [out.med out.mean out.std out.p5 out.p1 out.p90 out.p95];

% Create structure to pass into table writing program
table.mat = summaryMat;
table.rowLabels = paramNames;
table.colLabels = {'Median', 'Mean', 'Std', '$5$ pct', '$10$ pct', '$90$ pct', '$95$ pct'};
table.tableHeader = options.tableHeader;
table.corner = 'Parameter';

% Write table
multiPageTable(table,options);

end
        